#comments-start - More Info Dialog
[SCRIPT NAME]Copy Files To Clipboard
Description:
    - Copies file(s) from the specified path to the clipboard.

Arguments:
    - Arg1: Path to folder (Required) - e.g. C:\MyFiles
    - Arg2: File Name [Optional]
        - By default, all files are copied to the clipboard.
    - Arg3: Filter [Optional]
        - By default all files will be copied.
        - *.bmp will copy all .bmp files
#comments-end - More Info Dialog
#include <Include\WinClickPro.au3>
#include <Include\File.au3>
#include <Include\Misc.au3>

Func Main()
	Local $sFolderPath = ""
	Local $sFileName = "" ; Default is none
	Local $sFilter = "*" ; Default

	;
	; This script has 1 required argument and 2 optional.
	;
	If $CmdLine[0]  < 1 Then
		_DisplayErrorAndExit("Invalid argument count detected!" & @LF & "Count: " & $CmdLine[0])
	EndIf

	$sFolderPath = $CmdLine[1];

	;
	; Did the user specify the optional file name?
	;
	If $CmdLine[0] > 1 Then
		$sFileName = $CmdLine[2]
	EndIf

	;
	; Did the user specify a filter?
	;
	If $CmdLine[0] > 2 Then
		$sFilter = $CmdLine[3]
		If $sFilter == "" Then
			$sFilter = "*" ; User passed in a blank Arg, reset to default.
		EndIf
	EndIf

	If Not FileExists($sFolderPath) Then
		_DisplayErrorAndExit("Folder does not exist!" & @LF & "Folder: " & $sFolderPath)
	EndIf

	;
	; Make sure the folder path has a trailing \ if the user didn't provide it
	;
	If StringRight($sFolderPath, 1) <> "\" Then
		$sFolderPath = $sFolderPath & "\"
	EndIf

	If $sFileName <> "" Then
		Local $oFile = FileRead($sFolderPath & $sFileName)
		ClipPut($oFile)
		FileClose($oFile)
	Else
		Local $listOfFiles = _FileListToArray($sFolderPath, $sFilter, 1) ; 1 is to only return files and not folders.

		Local $sDelmitedFileList = ""
		;
		; Loop through all the files we've filtered in the target folder
		;
		For $j = 1 To $listOfFiles[0]
			$sDelmitedFileList = $sDelmitedFileList & $sFolderPath & $listOfFiles[$j]
			;
			; Do we need add a delimiter?
			;
			If $j <> $listOfFiles[0] Then
				$sDelmitedFileList = $sDelmitedFileList & "|"
			EndIf
		Next

		_ClipPutFile($sDelmitedFileList, "|")
	EndIf
EndFunc

Main()
Exit @error